﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
namespace CoreLib
{
   public class CDynamicComponent:CBaseComponent
    {
        private Matrix[] transforms;

        public Matrix[] Transforms
        {
            get { return transforms; }
            set { transforms = value; }
        }

        private Vector3 positionVector3;

        public Vector3 PositionVector3
        {
            get { return positionVector3; }
            set { positionVector3 = value;
            positionMatrix = Matrix.CreateTranslation(positionVector3);
            }
        }

        private Matrix positionMatrix;

        public Matrix PositionMatrix
        {
            get { return positionMatrix; }
            set { positionMatrix = value;

            }
        }
        private Vector3 rotationVector3;

        public Vector3 RotationVector3
        {
            get { return rotationVector3; }
            set { rotationVector3 = value;
            RotationMatrix = Matrix.CreateRotationX(RotationVector3.X);
            RotationMatrix = Matrix.CreateRotationY(RotationVector3.Y);
            RotationMatrix = Matrix.CreateRotationZ(RotationVector3.Z);
            }
        }

        private Matrix rotationMatrix;

        public Matrix RotationMatrix
        {
            get { return rotationMatrix; }
            set { rotationMatrix = value; }
        }

        private Vector3 scaleVector3;

        public Vector3 ScaleVector3
        {
            get { return scaleVector3; }
            set { scaleVector3 = value; }
        }
        private Matrix scaleMatrix=Matrix.CreateScale(1f,1f,1f);

        public Matrix ScaleMatrix
        {
            get { return scaleMatrix; }
            set { scaleMatrix = value; }
        }

        /// <summary>
        /// Up vector.
        /// </summary>
        public Vector3 Up
        {
            get { return up; }
            set { up = value; }
        }
        private Vector3 up = Vector3.Up;


        private Vector3 forward;

        public Vector3 Forward
        {
            get { return forward; }
            set { forward = value; }
        }
        private bool stayOnGround;

        public bool StayOnGround
        {
            get { return stayOnGround; }
            set { stayOnGround = value; }
        }
       public CDynamicComponent(Game game)
           : base(game)
       {
           RotationMatrix = Matrix.Identity;
           PositionMatrix = Matrix.Identity;
           ScaleMatrix = Matrix.Identity;

        
       }
       private Matrix world;

       public Matrix World
       {
           get { return world; }
           set { world = value; }
       }
       public override void Update(GameTime gameTime)
       {
            Vector3 vec;
            
           base.Update(gameTime);
       }
       public override void Draw(GameTime gameTime)
       {
           base.Draw(gameTime);
       }
    }
}
